import { useParams } from 'react-router-dom'

const detailData = [
  { id: '001', content: '你好, React' },
  { id: '002', content: '你好, Vue' },
  { id: '003', content: '你好, Angular' },
]

export default function MsgDetail() {
  const params = useParams()
  const findResult = detailData.find(item => item.id === params.id)
  return (
    <div>
      <ol>
        <li>id: {findResult.id}</li>
        <li>title: {params.title}</li>
        <li>content: {findResult.content}</li>
      </ol>
    </div>
  )
}
